package com.yjz.jvm.list;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;


@Slf4j
public class test {
  /**
   * @description:hashMap学习
   * @author :yuanJinZhong
   * @date :2018/8/16-16:45
   */
  @Test
  public void hashMapTest() {
    Map map = new HashMap<>(17);
    map.put("name", "张三");
    map.put("name1", "张三");
    log.info("容量:" + map.size());
    log.info("容量:" + map.entrySet());
  }

  @Test
  public void linkArryListTest() {
    List list = new LinkedList();
    list.add("张三");
    list.add("李四");
    log.info(list.get(1).toString());
    log.info(list.toString());
  }

  /**
   * @description:
   * @author     :yuanJinZhong
   * @date       :2018/11/8-17:56
   */
  /**
   * {@link Comparable}
   */
  @Test
  public void concurrentHashMapTest() {
    Map cMap = new ConcurrentHashMap<>();
    cMap.put("name", "张三");
    log.info(cMap.toString());
  }

  @Test
  public void vectorTest() {
    List vList = new Vector<>();
    vList.add("张三");
  }


}
